<template>
	<view class="content">
		<view style="height: 120rpx;background-color: #F0F0F0;">
			<view class="wid90 mar dis disAl disJuB hei100">
				<view style="width: 520rpx;" class="hei80 borRad40 bacFFF dis disAl">
					<input class="wid90 mar" placeholder="请输入关键字" @input="onKeyInput"/>
				</view>
				<view style="width: 130rpx;background-color: #1262DB;" class="hei80 dis disAl disJuC coFFF borRad40">搜索</view>
			</view>
		</view>
		<view class="wid90 mar">
			<view class="hei80 dis disAl disJuB">
				<view>热门搜索</view>
				<image v-if="!True" @click="True = !True" src="../../static/personalCenter/yincang.png" style="width: 39rpx;height: 23rpx;"></image>
				<image v-if="True" @click="True = !True" src="../../static/personalCenter/xianshi.png" style="width: 39rpx;height: 23rpx;"></image>
			</view>
			<view v-if="!True" class="hei80 dis disAl disJuC" style="color: #767778;">当前热门搜索已隐藏</view>
			<view v-if="True" class="wid90 mar ">
				
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: '',
				url: this.global.url,
				inputValue: '',
				// 判断是否还在继续输入
				timer: null,
				True: true
			}
		},
		onLoad() {
		},
		methods: {
			onKeyInput: function(event) {
				if (this.timer !== null) clearTimeout(this.timer)
				this.timer = setTimeout(() => {
					this.inputValue = event.target.value
					this.page = 0
					// this.getList()
				}, 1000)
			},
			getList(){
				var that = this
				uni.request({
				    url: that.global.url + 'api/classroom/details',
				    method: "POST",
					header: {
						'token': uni.getStorageSync('token')
					},
				    data: {
						id: this.id
					},
				    success(res) {
				        let result = res.data
				        if(result.code == 1){
							that.list = result.data
						}else{
				           uni.showToast({
				           	title: result.msg,
				           	icon: 'error'
				           })
				        }
				       
				    }
				})
			},
		}
	}
</script>

<style>
	.content {
		height: 100vh;
	}
</style>
